#pragma once
#include "Transform.h"
/**
* This class encapsulates the data for a perspective transform.
* @author Koen Samyn
*/
class ProjectionTransform: public Transform
{
public:
	/**
	* Creates a default lefthanded projection transform.
	*/
	ProjectionTransform();
	/**
	* Creates a new projection transform.
	* @param leftHanded if true this projection will be lefthanded, if false
	* the projection will be righthanded. A lefthanded view transform corresponds
	* with a lefthanded projection transform.
	*/
	ProjectionTransform(bool leftHanded);
	/**
	* Destroys the projection transform.
	*/ 
	virtual ~ProjectionTransform(void);
	/**
	* Sets the projection parameters.
	* @param fieldOfView the field of view for the camera.
	* @param nearClip the near clip distance.
	* @param farClip the far clip distance.
	* @param aspectRatio the aspect ration for the camera.
	*/
	void SetProjectionParameters(float fieldOfView,float nearClip, float farClip,float aspectRatio);
	/**
	* Returns the field of view for the ProjectionTransform.
	* @return the field of view (in degrees).
	*/
	float GetFieldOfView() const{return m_FieldOfView;}
	/**
	* Returns the near clip plane for the ProjectionTransform.
	* @return the near clip plane.
	*/
	float GetNearClip() const {return m_NearClip;}
	/**
	* Returns the far clip plane for the ProjectionTransform.
	* @return the far clip plane.
	*/
	float GetFarClip() const{return m_FarClip;}
	/**
	* Returns the aspect ration for the ProjectionTransform.
	* @return the aspect ration.
	*/
	float GetAspectRatio() const {return m_AspectRatio;}
	/**
	* Resets the parameters of the transform.
	* Must be implemented by subclass.
	*/
	void ResetTransformParameters();
	/**
	* Recalculates the matrix
	*/
	void RecalculateMatrix() const;
private:
	/**
	* The field of view for the projection transform.
	*/ 
	float m_FieldOfView;
	/**
	* Sets the near clip distance.
	*/
	float m_NearClip;
	/**
	* Sets the far clip distance.
	*/
	float m_FarClip;
	/**
	* Sets the aspect ratio for the projection transform.
	*/
	float m_AspectRatio;
	/**
	* Indicates that this is a lefthanded projection transform.
	*/
	bool m_LeftHanded;

	// -------------------------
	// Disabling default copy constructor and default assignment operator.
	// If you get a linker error from one of these functions, your class is internally trying to use them. This is
	// an error in your class, these declarations are deliberately made without implementation because they should never be used.
	// -------------------------
	ProjectionTransform(const ProjectionTransform& t);
	ProjectionTransform& operator=(const ProjectionTransform& t);
};
